<script type="text/javascript">

function dummytestdata() {
	
	$("#firma_navn").val('mwc'); 
	$("#name").val('dung'); 
	$("#lastname").val('le'); 
	$("#adresse").val('le van sy');  
	$("#post").val('1111'); 
	$("#by_").val('hcm'); 
	$("#cvr").val('12345678'); 
	$("#telefone").val('09089878'); 
	$("#email").val('le.dung@mwc.vn'); 
	$("#confirm_email").val('le.dung@mwc.vn'); 
	$("#password").val('123456'); 
	$("#password2").val('123456'); 
	$("#accept").attr("checked","checked"); 
	 }
	   

	$(document).ready(function(){
		$("#post").mask("9999",{placeholder:""}); 
		$("#cvr").mask("99999999",{placeholder:""}); 
		$("#telefone").mask("99999999",{placeholder:""}); 
		 
		if( $('#system-message dd ul li').length > 0) {
			$('#alertcommon .message').html($('#system-message dd ul li').html());
			$('#alertcommon_tb').click();
		}
		
		//dummytestdata(); 
		
		register=function(){
            
            
	    	
			    if($('#firma_navn').val()=="")
			    {

			      $('#firma_navn').focus();	 
			      $('#firma').click();
				  
				  return false;
			    } 
				 if($('#password').val()=="")
			    {

			      $('#password').focus();	 
			      $('#password_tb').click();
				  
				  return false;
			    }
		
			    if($('#password').val() !== $('#password2').val())
			    {

			      $('#password2').focus();	 
			      $('#password2_tb').click();
				  
				  return false;
			    }
			    if($('#adresse').val()=="")
			    {

			      $('#adresse').focus();	 
			      $('#adress').click();
				  
				  return false;
			    } 
			    if($('#post').val()=="")
			    {
				
			      $('#post').focus();	 
			      $('#post_tb').click();
				  
				  return false;
			    } else {
					if( /^\d{4}$/.test($('#post').val()) ==false )
					{
						 $('#post').focus();	 
						 $('#post_tb').click();
						  
						 return false;
					}  
				} 
			    if($('#by_').val()=="")
			    {

			      $('#by_').focus();	 
			      $('#by_tb').click();
				  
				  return false;
			    } 

                 
			    if($('#cvr').val()=="")
			    {

			      $('#cvr').focus();	 
			      $('#cvr_tb').click();
				  
				  return false;
			    } else {
					if( /^\d{8}$/.test($('#cvr').val()) ==false )
					{
						 $('#cvr').focus();	 
			     		 $('#cvr_tb').click();
						  return false;
					}  
				} 
			
			
			    if($('#name').val()=="")
			    {

			      $('#name').focus();	 
			      $('#name_tb').click();
				  
				  return false;
			    } 
			
			    if($('#lastname').val()=="")
			    {

			      $('#lastname').focus();	 
			      $('#lastname_tb').click();
				  
				  return false;
			    } 
       
			    if($('#telefone').val()=="")
			    {

			      $('#telefone').focus();	 
			      $('#telefone_tb').click();
				  
				  return false;
			    } 
				 else {
					if( /^\d{8}$/.test($('#telefone').val()) ==false )
					{
						  $('#telefone').focus();	 
			      		  $('#telefone_tb').click();
				  		  return false;
					}  
				} 
			    if($('#email').val()=="")
			    {

			      $('#email').focus();	 
			      $('#email_tb').click();
				  
				  return false;
			    } 
			    else{
					if(!isEmail($('#email').val())){
						$('#email').focus();	 
					      $('#email_tb').click();
						return false;	
					}
				}
      
			    if($('#email').val() !== $('#confirm_email').val())
			    {

			      $('#confirm_email').focus();	 
			      $('#confirm_email_tb').click();
				  
				  return false;
			    } 
			   
			    if(!$('#accept').attr('checked')){
			    	$('#accept_tb').click();
					return false;	
				}
		
	
	    return true;
		
		
	};
    
    
	isEmail=function(string) {
		if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
			return true;
		else return false;
    };
    
    
    });
	
	
	 
</script>
<div class="inner clearfix">
                        <!-- Tilmeld Malerfirma Form-->
                        <?php $info = getArticles(12);
							  $images = json_decode($info[0]->images);
							  $session =& JFactory::getSession();  
						?>
                       
                       
                        <div class="content-decoration w975 h638 bor-std" style=" <?php if (is_file($images->image_intro)) {echo "background: url('".$images->image_intro."') no-repeat scroll right bottom #FFFFFF;";} else {echo "background: url('templates/3dmaler/img/main-img-bg.jpg') no-repeat scroll right bottom #FFFFFF;";} ;?>  ">
                        	<div class="content-inner">
                                <div class="content-view w520">
                                    <h2 class="blue-txt">Tilmeld malerfirma</h2>
                                    <form id="tilmeldMalerfirmaForm" class="tilmeld-form" method="post" action="">
                                        <fieldset>
                                            <div class="input-set-ctn">
                                            	
                                            	
                                            	<p class="input-set">
                                                	<label>Firmanavn<span>*</span></label>
                                                	<input class="input-txt" type="text" name="firma_navn" id="firma_navn" value="<?php if($session->get('firma_navn')) echo $session->get('firma_navn'); ?>" />
                                                </p>
                                                 <p class="input-set">
                                                	<label>Adgangskode<span>*</span></label>
                                                	<input class="input-txt short" type="password" name="password" id="password" value="<?php if($session->get('password')) echo $session->get('password'); ?>" />
                                                </p>
                                                <p class="input-set">
                                                	<label>Gentag adgangskoden<span>*</span></label>
                                                	<input class="input-txt short" type="password" name="password2" id="password2" value="<?php if($session->get('password')) echo $session->get('password'); ?>" />
                                                </p> 
                                                <p class="input-set">
                                                	<label>Adresse<span>*</span></label>
                                                	<input class="input-txt" type="text" name="adresse" id="adresse" value="<?php if($session->get('adresse')) echo $session->get('adresse'); ?>" />
                                                <p class="input-set">
                                                	<label></label>
                                                	<input class="input-txt post-num" type="text" title="Postnr.*" name="post" id="post" value="<?php if($session->get('post')) echo $session->get('post'); ?>" />
                                                	<input class="Input-txt city" type="text" title="By*" name="by_" id="by_" value="<?php if($session->get('by_')) echo $session->get('by_'); ?>" />
                                                </p>
                                                
                                                <p class="input-set">
                                                	<label>CVR-nr.<span>*</span></label>
                                                	<input class="input-txt short marb15" type="text" name="cvr" id="cvr" value="<?php if($session->get('cvr')) echo $session->get('cvr'); ?>" />
                                                </p>
                                                <p class="input-set">
                                                	<label>Kontaktpersonens fornavn<span>*</span></label>
                                                	<input class="input-txt" type="text" name="name" id="name" value="<?php if($session->get('name')) echo $session->get('name'); ?>" />
                                                </p>
                                                <p class="input-set">
                                                	<label>Kontaktpersonens efternavn<span>*</span></label>
                                                	<input class="input-txt" type="text" name="lastname" id="lastname" value="<?php if($session->get('lastname')) echo $session->get('lastname'); ?>" />
                                                </p>
                                                <p class="input-set">
                                                	<label>Telefonnummer<span>*</span></label>
                                                	<input class="input-txt short" type="text" name="telefone" id="telefone" value="<?php if($session->get('telefone')) echo $session->get('telefone'); ?>" />
                                                </p>
                                                <p class="input-set">
                                                	<label>E-mail-adresse<span>*</span></label>
                                                	<input class="input-txt" type="text" name="email" id="email" value="<?php if($session->get('email')) echo $session->get('email'); ?>" />
                                                </p>
                                                <p class="input-set">
                                                	<label>Gentag e-mail-adresse<span>*</span></label>
                                                	<input class="input-txt short" type="text" name="confirm_email" id="confirm_email" value="<?php if($session->get('email')) echo $session->get('email'); ?>" />
                                                </p>
                                               
                                                <p class="input-set check-box">
                                                	<label class="check-box"><input class="check-box" type="checkbox" id="joinNewsLetter" name="joinNewsLetter" />Tilmeld nyhedsbrev</label>
                                                    <label class="check-box">
                                                    <?php
													// category brugerbetingelserne tilmeld firma
													$items = getArticles(34);
													$slug = $items[0]->id.':'.$items[0]->alias;
								$catslug =$items[0]->catid ? $items[0]->catid .':'.$items[0]->category_alias : $items[0]->catid;
								require_once JPATH_SITE.'/components/com_content/helpers/route.php';
								$readmore = JRoute::_(ContentHelperRoute::getArticleRoute($slug, $catslug));
                                                    ?>
                                                    <input class="check-box" type="checkbox" id="accept" />Jeg accepterer <a href="<?php echo $readmore;?>" target="_blank">brugerbetingelserne.</a></label>
                                                </p>
                                            </div>
                                            <div class="form-submit padt15">
                                                <input class="button reset-btn flr" type="reset" value="Nulstil" />
                                                 <input class="button send-btn thickbox flr" alt="#TB_inline?height=125&width=260&inlineId=alertfirma" type="hidden" value="Godkend" id="firma"/> 
                                                 <input class="button send-btn thickbox flr" alt="#TB_inline?height=125&width=260&inlineId=alertadress" type="hidden" value="Godkend" id="adress"/> 
                                                 <input class="button send-btn thickbox flr" alt="#TB_inline?height=125&width=260&inlineId=alertpost" type="hidden" value="Godkend" id="post_tb"/> 
                                                 <input class="button send-btn thickbox flr" alt="#TB_inline?height=125&width=260&inlineId=alertby" type="hidden" value="Godkend" id="by_tb"/> 
                                                 
                                                 <input class="button send-btn thickbox flr" alt="#TB_inline?height=125&width=260&inlineId=alertcvr" type="hidden" value="Godkend" id="cvr_tb"/> 
                                                 <input class="button send-btn thickbox flr" alt="#TB_inline?height=125&width=260&inlineId=alertname" type="hidden" value="Godkend" id="name_tb"/> 
                                                 <input class="button send-btn thickbox flr" alt="#TB_inline?height=125&width=260&inlineId=alertlastname" type="hidden" value="Godkend" id="lastname_tb"/> 
                                                 <input class="button send-btn thickbox flr" alt="#TB_inline?height=125&width=260&inlineId=alerttelefone" type="hidden" value="Godkend" id="telefone_tb"/> 
                                                 <input class="button send-btn thickbox flr" alt="#TB_inline?height=125&width=260&inlineId=alertemail" type="hidden" value="Godkend" id="email_tb"/> 
                                                 <input class="button send-btn thickbox flr" alt="#TB_inline?height=125&width=260&inlineId=alertconfirm_email" type="hidden" value="Godkend" id="confirm_email_tb"/> 
                                                 <input class="button send-btn thickbox flr" alt="#TB_inline?height=125&width=260&inlineId=alertpassword" type="hidden" value="Godkend" id="password_tb"/> 
                                                 <input class="button send-btn thickbox flr" alt="#TB_inline?height=125&width=260&inlineId=alertpassword2" type="hidden" value="Godkend" id="password2_tb"/> 
                                                 <input class="button send-btn thickbox flr" alt="#TB_inline?height=125&width=260&inlineId=alertaccept" type="hidden" value="Godkend" id="accept_tb"/> 
                                                 <input class="button send-btn thickbox flr" alt="#TB_inline?height=125&width=260&inlineId=alertcommon" type="hidden" value="Godkend" id="alertcommon_tb"/> 
                                                 <input type="hidden" name="option" value="com_users" />
												 <input type="hidden" name="task" value="registration.register" />
												 <?php echo JHtml::_('form.token');?>
                                                 <input class="button send-btn  flr"  type="button" value="Godkend" onclick="if(register())$('#tilmeldMalerfirmaForm').submit();" />
                                                
                                            </div>
                                           
                                            <div id="alertfirma" style="display:none;">
                                            	<div class="content-view">
                                                    <h2 class="blue-txt center"></h2>
                                                    <p class="message" >Udfyld venligst rubrikken: “Firmanavn”</p>
                                                 </div>   
                                            </div> 
                                            
                                             <div id="alertadress" style="display:none;">
                                          	   <div class="content-view">
                                            	<h2 class="blue-txt center"></h2>
                                                <p class="message" >Udfyld venligst både “Adresse"</p>
                                                </div>
                                            </div> 
                                             <div id="alertpost" style="display:none;">
                                             	<div class="content-view">
                                            	<h2 class="blue-txt center"></h2>
                                                <p class="message" >Udfyld venligst både “Postnr"</p>
                                                </div>
                                            </div> 
                                            <div id="alertby" style="display:none;">
                                          		  <div class="content-view">
                                            	<h2 class="blue-txt center"></h2>
                                                <p class="message" >Udfyld venligst både “By”</p>
                                                </div>
                                            </div> 
                                            
                                            <div id="alertcvr" style="display:none;">
                                       		    <div class="content-view">
                                            	<h2 class="blue-txt center"></h2>
                                                <p class="message" >Der er ikke indtastet et gyldigt CVR-nummer</p>
                                                </div>
                                            </div> 
                                            <div id="alertname" style="display:none;">
                                        	    <div class="content-view">
                                            	<h2 class="blue-txt center"></h2>
                                                <p class="message" >Udfyld venligst rubrikken: ”Kontaktpersonens fornavn"</p>
                                                </div>
                                                
                                            </div> 
                                            <div id="alertlastname" style="display:none;">
                                          		<div class="content-view">
                                            	<h2 class="blue-txt center"></h2>
                                                <p class="message" >Udfyld venligst rubrikken: ”Kontaktpersonens efternavn”</p>
                                                </div>
                                                
                                            </div> 
                                            <div id="alerttelefone" style="display:none;">
                                        	    <div class="content-view">
                                            	<h2 class="blue-txt center"></h2>
                                                <p class="message" >Indtast venligst et 8-cifret telefonnummer</p>
                                            	</div>
                                            </div> 
                                            <div id="alertemail" style="display:none;">
                                           		<div class="content-view">
                                            	<h2 class="blue-txt center"></h2>
                                                <p class="message" >Indtast venligst en gyldig e-mail-adresse</p>
                                                </div>
                                            </div>
                                            <div id="alertconfirm_email" style="display:none;">
                                            	<div class="content-view">
                                            	<h2 class="blue-txt center"></h2>
                                                <p class="message" >De to indtastede e-mail-adresser er ikke ens</p>
                                                </div>
                                                
                                            </div>
                                            <div id="alertpassword" style="display:none;">
                                            	<div class="content-view">
                                            	<h2 class="blue-txt center"></h2>
                                                <p class="message" >Skriv venligst din ønskede adgangskode</p>
                                                </div>
                                            </div>
                                            <div id="alertpassword2" style="display:none;">
                                           		<div class="content-view">
                                            	<h2 class="blue-txt center"></h2>
                                                <p class="message" >De 2 indtastede adgangskoder er ikke ens</p>
                                                </div>
                                                
                                            </div>
                                             <div id="alertaccept" style="display:none;">
                                            	 <div class="content-view">
                                            	<h2 class="blue-txt center"></h2>
                                                <p class="message" >Du skal markere, at du acceptere brugerbetingelserne, for at
kunne gå videre</p>
</div>
                                                
                                            </div>
                                            <div id="alertcommon" style="display:none;">
                                             	<div class="content-view">
                                            	<h2 class="blue-txt center"></h2>
                                                <p class="message" ></p>
												</div>
                                            </div>
                                        </fieldset>
                                    </form>
                                </div>
                        	</div>
                        </div>
                        <!-- /Tilmeld Malerfirma Form-->
                        
                    </div>   

<?php
		$session->set('firma_navn','');
		$session->set('adresse', '');
		$session->set('post', '');
		$session->set('firma_navn', '');
		$session->set('by_','');
		$session->set('cvr', '');
		$session->set('telefone', '');
		$session->set('by_', '');
		$session->set('name', '');
		$session->set('lastname', '');
		$session->set('email', '');
		$session->set('password', '');
?>                    


<?php
return;
/**
 * @package		Joomla.Site
 * @subpackage	com_users
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 * @since		1.6
 */

defined('_JEXEC') or die;

JHtml::_('behavior.keepalive');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
?>
<div class="registration<?php echo $this->pageclass_sfx?>">
<?php if ($this->params->get('show_page_heading')) : ?>
	<h1><?php echo $this->escape($this->params->get('page_heading')); ?></h1>
<?php endif; ?>

	<form id="member-registration" action="<?php echo JRoute::_('index.php?option=com_users&task=registration.register'); ?>" method="post" class="form-validate">
<?php foreach ($this->form->getFieldsets() as $fieldset): // Iterate through the form fieldsets and display each one.?>
	<?php $fields = $this->form->getFieldset($fieldset->name);?>
	<?php if (count($fields)):?>
		<fieldset>
		<?php if (isset($fieldset->label)):// If the fieldset has a label set, display it as the legend.?>
			<legend><?php echo JText::_($fieldset->label);?></legend>
		<?php endif;?>
			<dl>
		<?php foreach($fields as $field):// Iterate through the fields in the set and display them.?>
			<?php if ($field->hidden):// If the field is hidden, just display the input.?>
				<?php echo $field->input;?>
			<?php else:?>
				<dt>
				<?php echo $field->label; ?>
				<?php if (!$field->required && $field->type != 'Spacer'): ?>
					<span class="optional"><?php echo JText::_('COM_USERS_OPTIONAL');?></span>
				<?php endif; ?>
				</dt>
				<dd><?php echo $field->input;?></dd>
			<?php endif;?>
		<?php endforeach;?>
			</dl>
		</fieldset>
	<?php endif;?>
<?php endforeach;?>
		<div>
			<button type="submit" class="validate"><?php echo JText::_('JREGISTER');?></button>
			<?php echo JText::_('COM_USERS_OR');?>
			<a href="<?php echo JRoute::_('');?>" title="<?php echo JText::_('JCANCEL');?>"><?php echo JText::_('JCANCEL');?></a>
			<input type="hidden" name="option" value="com_users" />
			<input type="hidden" name="task" value="registration.register" />
			<?php echo JHtml::_('form.token');?>
		</div>
	</form>
</div>
